package com.wondertek.poms.dao.repo;

import com.wondertek.poms.dao.po.ContentBlack;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * <p><b>IContentBlackDao Description:</b> 黑名单表Dao 执行黑名单表的查询、修改、新增、删除操作</p>
 * <p>@author 窦再兴</p>
 * <p><b>DATE</b> 2020-12-03 10:19:26</p>
 */
public interface IContentBlackDao extends JpaRepository<ContentBlack, Long> {

	@Query(value = "select count(*) from CONTENT_BLACK c where c.deleted = 0 and c.CONTENT_ID = ?1 and c.PRD_INFO_ID = ?2",
			nativeQuery = true)
	int findCountByContentIdAndPackageId(String contentId, Long packageId);

	List<ContentBlack> findAllByContentIdAndPrdInfoId(String contentId, Long prdInfoId);

}
